package com.pinc.cpbl;

import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

import com.pinc.cpbl.Menu_Adapter.generalClickListener;
import com.pinc.cpbl.Menu_Adapter.menu_class;

public class Allstar extends WidgetActivity {
	private Menu_Adapter mAdapter;
	private ListView lv;
	public static final	String ALLSTAR_PREF = "Allstar_Pref";

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.list_layout);
		initWidget();

		mAdapter = new Menu_Adapter(this);
		mAdapter.addMenuItem(new menu_class(getResources().getString(R.string.title_allstar_result), new generalClickListener(this, Allstar_Result.class)));
		mAdapter.addMenuItem(new menu_class(getResources().getString(R.string.title_allstar_vote), new generalClickListener(this, Allstar_Login.class)));

		lv.setAdapter(mAdapter);
		lv.setOnItemClickListener(new OnItemClickListener(){
			@Override
			public void onItemClick(AdapterView<?> arg0, View v, int position, long id) {
				mAdapter.getClickListener(position).onClick(v);
			}
		});
	}

	@Override
	protected void initUpbar() {
		tv_title.setText(R.string.title_all_star);
		b_right.setVisibility(View.INVISIBLE);
		mProgbar.setVisibility(View.INVISIBLE);
	}

	@Override
	protected void initWidget() {
		super.initWidget();
		lv = (ListView)this.findViewById(R.id.listView1);
	}

}
